{include file="news/header.tpl"}
<!-- 头部// -->
<!-- start: Content -->
<div id="content" class="">


<div class="row-fluid">


<div class="well"><!-- Default panel contents -->



<div class="box-content">



<form name="news" action="./index.php?comment/search" method="post"
	class="form-inline suoding"><select name="type" class="span1">
	<option value="real_name">{$lang['USERNAME']}</option>
	<option value="mobile_phone">{$lang['MOBILE']}</option>
</select>
<div class="input-append"><input value="" type="text" class="control"
	name="value">
<button type="submit" class="btn btn-default"><i class="icon-search"></i>
</button>

</div>

	</form>
	
	<ul class="nav nav-tabs" id="myTab"> 
      <li class="active"><a href="#welcome">欢迎词</a></li> 

      <li><a href="#button">按钮</a></li> 
    <li><a href="#server">人工客服</a></li> 
    </ul>
    
    
<div class="tab-content"> 

<div class="tab-pane active" id="welcome">
  <div class="control-group">

          <!-- Textarea -->
          <div class="controls">
            <div class="textarea">
                  <textarea id="welcomecon" style="width:400px;height:100px;" name="value">{$welcome.value} </textarea>
            </div>
          </div>
        </div>
        
        <div class="control-group">
          <label class="control-label"></label>

          <!-- Button -->
          <div class="controls">
            <button class="btn btn-success" onclick="savewelcome(2)">保存</button>
          </div>
        </div>

</div>

<div class="tab-pane" id="button">

  <div class="control-group">

          <!-- Textarea -->
          <div class="controls">
            <div class="textarea">
                  <textarea id="buttoncon" style="width:400px;height:300px;" name="value">
                  {$button.value}
                   </textarea>
            </div>
          </div>
        </div>
        
        <div class="control-group">
          <label class="control-label"></label>

          <!-- Button -->
          <div class="controls">
            <button class="btn btn-success" onclick="savebutton()">保存</button>
          </div>
        </div>
</div>
<div class="tab-pane" id="server">
      <!-- Textarea -->
          <div class="controls">
            <div class="textarea">
                  <textarea id="servercon" style="width:400px;height:100px;" name="value">{$server.value} </textarea>
            </div>
          </div>
        
        <div class="control-group">
          <label class="control-label"></label>

          <!-- Button -->
          <div class="controls">
            <button class="btn btn-success" onclick="savewelcome(4)">保存</button>
          </div>
        </div>

</div>
	
	
	
  

       
     
  </div>
  {literal}
  <script>

  $(function () { 
	    $('#myTab a:first').tab('show'); // Select first tab 
	        $('#myTab a').click(function (e) { 
	            
	          e.preventDefault();//阻止a链接的跳转行为 
	          $(this).tab('show');//显示当前选中的链接及关联的content 
	        }) 
	      }) 
  
  function savewelcome(id){
	  if(id==2){
var con=$("#welcomecon").val();
	  }else{
var con=$("#servercon").val();
		  }
$.post("./index.php?weixin/saveconfig",{value:con,id:id},function(data){

	alert(data.message);
},"json")
}
  function savebutton(){
	  var con=$("#buttoncon").val();
	  $.post("./index.php?weixin/savebutton",{value:con},function(data){

	  	alert(data.message);
	  },"json")
	  }
  </script>
  {/literal}
  
  {include file="news/footer.tpl"}
